<?php
class model_mongo
{
    private $mongo;
    
    private $connect;
    
    private $database;
    
    private $collection;
    
    public function __construct($connect, $database, $collection)
    {
        $this->connect    = $connect;
        $this->database   = $database;
        $this->collection = $collection;
        
        $this->init();
    }
    
    private function init()
    {
        $conn         =  new Mongo($this->connect);
        $db           =  $conn->selectDB($this->database);
        $this->mongo  =  new MongoCollection($db, $this->collection);
        
        return $this->mongo;
    }
    
    public function mongo_insert($data)
    {
        return $this->mongo->insert($data);
    }
    
    public function _mongo()
    {
        return $this->mongo;
    }

}
